package com.ruoyi.fs.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.fs.mapper.FsCaseExamineMapper;
import com.ruoyi.fs.domain.FsCaseExamine;
import com.ruoyi.fs.service.IFsCaseExamineService;

/**
 * 案件审核Service业务层处理
 * 
 * @author hero
 * @date 2024-08-31
 */
@Service
public class FsCaseExamineServiceImpl implements IFsCaseExamineService 
{
    @Autowired
    private FsCaseExamineMapper fsCaseExamineMapper;

    /**
     * 查询案件审核
     * 
     * @param id 案件审核主键
     * @return 案件审核
     */
    @Override
    public FsCaseExamine selectFsCaseExamineById(Long id)
    {
        return fsCaseExamineMapper.selectFsCaseExamineById(id);
    }

    /**
     * 查询案件审核
     *
     * @param bh 案件审核主键
     * @return 案件审核
     */
    @Override
    public FsCaseExamine selectFsCaseExamineByBh(String bh){
        FsCaseExamine query = new FsCaseExamine();
        query.setBh(bh);
        List<FsCaseExamine> list = fsCaseExamineMapper.selectFsCaseExamineList(query);
        if (list.isEmpty()) {
            return null;
        } else {
            return list.get(0);
        }
    }

    /**
     * 查询案件审核列表
     * 
     * @param fsCaseExamine 案件审核
     * @return 案件审核
     */
    @Override
    public List<FsCaseExamine> selectFsCaseExamineList(FsCaseExamine fsCaseExamine)
    {
        return fsCaseExamineMapper.selectFsCaseExamineList(fsCaseExamine);
    }

    /**
     * 新增案件审核
     * 
     * @param fsCaseExamine 案件审核
     * @return 结果
     */
    @Override
    public int insertFsCaseExamine(FsCaseExamine fsCaseExamine)
    {
        fsCaseExamine.setCreateTime(DateUtils.getNowDate());
        return fsCaseExamineMapper.insertFsCaseExamine(fsCaseExamine);
    }

    /**
     * 修改案件审核
     * 
     * @param fsCaseExamine 案件审核
     * @return 结果
     */
    @Override
    public int updateFsCaseExamine(FsCaseExamine fsCaseExamine)
    {
        fsCaseExamine.setUpdateTime(DateUtils.getNowDate());
        return fsCaseExamineMapper.updateFsCaseExamine(fsCaseExamine);
    }

    /**
     * 批量删除案件审核
     * 
     * @param ids 需要删除的案件审核主键
     * @return 结果
     */
    @Override
    public int deleteFsCaseExamineByIds(Long[] ids)
    {
        return fsCaseExamineMapper.deleteFsCaseExamineByIds(ids);
    }

    /**
     * 删除案件审核信息
     * 
     * @param id 案件审核主键
     * @return 结果
     */
    @Override
    public int deleteFsCaseExamineById(Long id)
    {
        return fsCaseExamineMapper.deleteFsCaseExamineById(id);
    }
}
